<!DOCTYPE html>
<html>
    <head>
        <!-- 页面meta -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>运营数据</title>
        <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
        <!-- 引入样式 -->
        <link rel="stylesheet" href="../plugins/elementui/index.css">
        <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
        <link rel="stylesheet" href="../css/style.css">
        <style>
            .grid-content {
                border-radius: 4px;
                min-height: 40px;
            }
        </style>
    </head>
    <body class="hold-transition">
        <div id="app">
            <div class="content-header">
                <h1>统计分析<small>运营数据</small></h1>
                <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
                    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                    <el-breadcrumb-item>统计分析</el-breadcrumb-item>
                    <el-breadcrumb-item>运营数据</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="app-container">
                <div class="box" style="height: 900px">
                    <div class="excelTitle" >
                        <el-button @click="exportExcel">导出Excel</el-button>运营数据统计
                    </div>
                    <div class="excelTime">日期：{{reportData.reportDate}}</div>
                    <table class="exceTable" cellspacing="0" cellpadding="0">
                        <tr>
                            <td colspan="4" class="headBody">会员数据统计</td>
                        </tr>
                        <tr>
                            <td width='20%' class="tabletrBg">新增会员数</td>
                            <td width='30%'>{{reportData.todayNewMember}}</td>
                            <td width='20%' class="tabletrBg">总会员数</td>
                            <td width='30%'>{{reportData.totalMember}}</td>
                        </tr>
                        <tr>
                            <td class="tabletrBg">本周新增会员数</td>
                            <td>{{reportData.thisWeekNewMember}}</td>
                            <td class="tabletrBg">本月新增会员数</td>
                            <td>{{reportData.thisMonthNewMember}}</td>
                        </tr>
                        <tr>
                            <td colspan="4" class="headBody">产奶数据统计</td>
                        </tr>
                        <tr>
                            <td class="tabletrBg">今日优质奶牛</td>
                            <td>{{reportData.todayGreatCow}}</td>
                            <td class="tabletrBg">今日总产奶量</td>
                            <td>{{reportData.todayTotalYield}}</td>
                        </tr>
                        <tr>
                            <td class="tabletrBg">本周优质奶牛</td>
                            <td>{{reportData.thisWeekGreatCow}}</td>
                            <td class="tabletrBg">本周总产奶量</td>
                            <td>{{reportData.thisWeekTotalYield}}</td>
                        </tr>
                        <tr>
                            <td class="tabletrBg">本月优质奶牛</td>
                            <td>{{reportData.thisMonthGreatCow}}</td>
                            <td class="tabletrBg">本月总产奶量</td>
                            <td>{{reportData.thisMonthTotalYield}}</td>
                        </tr>
                    </table>
                </div>
        </div>
    </body>
    <!-- 引入组件库 -->
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <script>
        var vue = new Vue({
            el: '#app',
            data:{
                reportData:{
                    reportDate:"2022-2-2 2:2",
                    todayNewMember :0,
                    totalMember :0,
                    thisWeekNewMember :0,
                    thisMonthNewMember :0,
                    todayTotalYield :0,
                    todayGreatCow :{"编号":101,"类型":"西伯利亚奶牛","产龄":2,"总产量":200,"状态":"优秀","舍号":203},
                    thisWeekTotalYield :0,
                    thisWeekGreatCow :{"编号":101,"类型":"西伯利亚奶牛","产龄":2,"总产量":200,"状态":"优秀","舍号":203},
                    thisMonthTotalYield :0,
                    thisMonthGreatCow :{"编号":101,"类型":"西伯利亚奶牛","产龄":2,"总产量":200,"状态":"优秀","舍号":203},
                }
            },
            created() {
                axios.get("/report/getBusinessReportData").then((res)=>{
                    this.reportData = res.data.data;
                });
            },
            methods:{
                exportExcel(){
                    window.location.href = '/report/exportBusinessReport';
                }
            }
        })
    </script>
</html>
